home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 2
/
Gekikoh Dennoh Club Vol. 2 (Japan).7z
/
Gekikoh Dennoh Club Vol. 2 (Japan) (Track 01).bin
/
kowin
/
font
/
tcwin24s.lzh
/
tc_put1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-05
|
2KB
|
119 lines
/*/ ******************************************************************* /*/
/*/ /*/
/*/ TC_WIN.win version 1.00 小笠原博之 SPS0783 COR. /*/
/*/ /*/
/*/ ******************************************************************* /*/
#include <stdio.h>
#include <wlib.h>
#include <parts.h>
Sheet put1chbuf= {
24,
24,
2
};
extern char *tcfont;
extern UskMes();
put1char( wp, x, y, font )
WindowID wp;
int x,
y;
unsigned short *font;
{
int i;
unsigned char *bp= (unsigned char*)(tcfont+ y*(72*16)+ x*3),
*fp= (unsigned char*)font,
ffb[4*24];
DrawBuf dbuf[1];
put1chbuf.buf2=
put1chbuf.buf1= (short*)ffb;
for( i= 0 ; i< 24 ; i++ ){
ffb[i*4+0]= fp[i*3+0];
ffb[i*4+1]= fp[i*3+1];
ffb[i*4+2]= fp[i*3+2];
ffb[i*4+3]= 255;
}
DrawSetPut( dbuf, x*24, y*24, &put1chbuf );
WindowDraw( wp, dbuf, 1 );
for( i= 0 ; i< 24 ; i++, bp+= 48 ){
bp[0]= *fp++;
bp[1]= *fp++;
bp[2]= *fp++;
}
/*
for( i=0 ; i<16 ; i++, bp+=16 )
*bp= font[i];
*/
}
del1char( wp, x, y )
WindowID wp;
int x,
y;
{
unsigned short buf[48];
memset( buf, 255, 96 );
put1char( wp, x, y, buf );
}
get1char( x, y, font )
int x,
y;
unsigned short *font;
{
int i;
/* unsigned short *bp= (unsigned short*)(tcfont+ y*512+ x*2);*/
unsigned char *bp= (unsigned char*)(tcfont+ y*(72*16)+ x*3),
*fp= (unsigned char*)font;
/* for( i=0 ; i<16 ; i++, bp+=16 )
*font++ = *bp;*/
for( i= 0 ; i< 24 ; i++, bp+= 48 ){
*fp++= bp[0];
*fp++= bp[1];
*fp++= bp[2];
}
}
fontcode( wp, info )
WindowID wp;
EventInfo *info;
{
int x,
y;
unsigned int code;
char str[80];
extern char fname[];
if( (info->x/24) >= 16 )
return;
x= (info->x)/24;
y= (info->y)/24;
code= y*16 + x;
if( code < 256 ){
sprintf( str, "ASCII:%02X (%3d) %s", code, code, fname );
}else{
int low;
code -= 256;
low= (code % 188)+ 0x40;
code= ( code/188 + 0x81 ) << 8;
if( low >= 0x7f )
low++;
code+= low;
if( code >= 0xa040 )
code+= 0x4000;
low= SFTJIS( code );
sprintf( str, "%04X-%04X-%02d%02d %s", code, low, (low/256)-32, (low&255)-32, fname );
}
UskMes( str, WindowGetParent(wp) );
}